package com.lemon.test.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lemon.test.bean.A;
import com.lemon.test.mapper.AMapper;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AServiceImpl extends ServiceImpl<AMapper, A> implements AService {

    @Override
    @DS("login_db")
    @GlobalTransactional
    public void save2() {
        A a1 = new A();
        a1.setId(1);
        a1.setName("插入db1的a1");
        this.save(a1);
        int a = 1 / 0;
    }


}
